#include "Log.hpp"
#include "ThreadPool.hpp"
#include <iostream>
#include<unistd.h>

using namespace LogModule;
using namespace ThreadPoolModule;

int cont = 0;
int task_num = 10;

class Task
{
private:
    void _task()
    {
        cont++;
        std::cout << "_task任务被执行，cont = " << cont << std::endl;
    }
public:
    void operator()()
    {
        _task();
    }
private:
    
};
Task _task;
int main()
{
    // ThreadPool<Task> thread_pool;

    // thread_pool.Start();
    // while (task_num--)
    //     thread_pool.Equeue(_task);
    // thread_pool.Stop();
    // sleep(3);
    // thread_pool.Wait();

    ThreadPool<Task>::GetPool()->Start();
    while(task_num--)
        ThreadPool<Task>::GetPool()->Equeue(_task);
    
    ThreadPool<Task>::GetPool()->Wait();
}